home *** CD-ROM | disk | FTP | other *** search
/ Cracking 1 / Cracking I..iso / Tools / Ostatní / aPLib v0.26b / examples / ada / aPLibAda.doc < prev    next >
Encoding:
Text File  |  2001-12-15  |  2.3 KB  |  97 lines

  1. aPLib Ada binding  v. 11.II.1998
  2. --------------------------------
  3.  
  4. Files
  5. -----
  6.  
  7. aplibada.doc  this file
  8. aplib.ads     package specification for aPLib Ada binding
  9. aplib.adb     package body for aPLib Ada binding
  10. apacdemo.adb  demo
  11. makeit.bat    make command for demo (with gnat compiler)
  12.  
  13.  
  14. Usage
  15. -----
  16.  
  17. The package is generic, so you can use it
  18. for any data - see specification, aplib.ads .
  19.  
  20. For the packed data type, it's simpler
  21. to use an array of bytes, so you can easily calibrate
  22. the safe size of packed data (see aplib.doc).
  23. If your data is named blabla, its size will be
  24.  
  25.   blabla'size in bits
  26.   blabla'size/8 in bytes
  27.  
  28. so the safe size in bytes for packed data will be
  29.  
  30.   (((blabla'size/8) * 9) / 8) + 16
  31.  
  32. the packed data will ideally be an
  33.   array(1..(((blabla'size/8) * 9) / 8) + 16) of byte
  34.  
  35. Read apacdemo.adb to see an example how to implement it.
  36.  
  37.  
  38. Binding the aPLib library
  39. -------------------------
  40.  
  41. For GNAT compiler, make your program (here the demo) with the command
  42.  
  43.   gnatmake apacdemo.adb -largs aplib.a
  44.  
  45. (add usual options if needed).
  46. Ignore the warnings. I was obliged to cheat about the in/out nature of
  47. parameters in the C functions.
  48.  
  49. Portability: full, provided the aPLib exists on your platform,
  50. of course !
  51.  
  52. How to run the demo
  53. -------------------
  54.  
  55. The command
  56.  
  57.   apacdemo a.x b.y c.z
  58.  
  59. will pack the contents of files a.x b.y c.z into
  60. packed.000, packed.001, packed.002 and unpack into
  61. pack_unp.000, pack_unp.001, pack_unp.002 .
  62.  
  63. Typical output:
  64.  
  65. D:\APACKADA>apacdemo frog.bmp
  66.   [==================|................................]
  67.   File: frog.bmp
  68.   Unpacked size:           66614
  69.   Packed size:             24865
  70.   Compression ratio: 37%
  71.  
  72.  
  73. How to get a free compiler
  74. --------------------------
  75.  
  76. Search the net for the GNU one, named GNAT. Full Ada95 implementation
  77. with libraries & sources.
  78.  
  79.   http://ftpsearch.lycos.com/cgi-bin/search?form=normal&query=gnat
  80.  
  81. Current version is GNAT 3.11
  82.  
  83. The DOS version is in a distribution named EZ2LOAD.
  84. Main:
  85.   ftp://ftp.gwu.edu/pub/ada/ez2load/
  86. Search:
  87.   http://ftpsearch.lycos.com/cgi-bin/search?form=normal&query=ez2load
  88.  
  89. Current DOS version is GNAT 3.10, using DJGPP 2.01 as back-end.
  90. A GNAT 3.11, using DJGPP 2.02, is currently being tested.
  91.  
  92.  
  93. Questions
  94. ---------
  95.  
  96. Send them to following e-mail: Gautier.deMontmollin@Maths.UniNe.CH
  97.